package com.mercury.emqx.controller;


import com.mercury.emqx.client.resp.MqttResp;
import com.mercury.emqx.manager.MqttManager;
import com.mercury.emqx.model.PayloadMessage;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author mercury
 */
@RestController
public class MqttController {

    @Resource
    private MqttManager mqttManager;


    @GetMapping("/sendMsg")
    public void sendMsg() {
        MqttResp<Object> objectMqttResp = mqttManager.sendMsg("topicA", "mercury1");
    }

    @GetMapping("/subscribe")
    public void show() {

        MqttResp<Object> topicA = mqttManager.subscribe("topicA");

    }
}
